import { data } from "../../uni_modules/uview-ui/libs/mixin/mixin";
import Request from "@/request/index.js";

//关键字小区搜索（当前区域）
export function getCommunity(name){
	return Request(`/front/house/community/area?area=昆山&name=${name}`, "get", null)
}
//获取经纬度
export function getRegeo(){
	return Request(`/front/map/regeo`, "get", null)
}
//获取首页轮播图
 
export function getCarousel(){
	return Request(`/front/landlord/banner/list`, "get", null)
 }
 
//刷新房源
export function getRefresh(){
	return Request(`/front/landlord/room/refresh`, "put", null)
}
//获取经营概览
export function getBusiness(){
	return Request(`/front/landlord/room/business`, "get", null)
}
//获取房东的房源数量
export function getQuantity(){
	return Request(`/front/landlord/room/quantity`, "get", null)
}
// 房东新增房源信息
export function addHouseInfo(houseInfo){
	return Request(`/front/landlord/room`, "post", houseInfo)
}

// 获取房东已录入的小区列表
export function getHouse(){
	return Request(`/front/house/community/add`, "get", null)
}

// 获取房东的所有房源列表（条件查询）

export function getListCommunityId(communityId = "",rentState = ""){
	return Request(`/front/landlord/room/list?communityId=${communityId}&rentState=${rentState}`, "get", null)
}

// 根据房源编号获取房源详情拼接参数
export function getLandlord(houseId){
	return Request(`/front/landlord/room/${houseId}`, "get", null)
}
 
 // 修改房源信息要先获取房源详情然后修改，媒体资源如果不传会把原有的删掉

export function putHouse(houseInfo){
	return Request(`/front/landlord/room`, "put", houseInfo)
}


//  新增租约会修改房源出租状态 

// /front/landlord/lease
export function landlordLease(houseInfo){
	return Request(`/front/landlord/lease`, "post", houseInfo)
}

//  获取当前房东的所有租约


export function landgetConfirm(leaseConfirmState){
	return Request(`/front/landlord/lease/getConfirm/${leaseConfirmState}`, "get", null)
}


//  根据租约编号获取待确认的租约详情

export function leaseDetail(id){
	return Request(`/front/landlord/lease/pending/${id}`, "get", null)
}

export function updateStateLease(leaseId, state){
	return Request(`/front/landlord/lease/updateState/${leaseId}/${state}`, "get", null)
}

export function checkLandlordRefresh(){
	return Request(`/front/checkRefresh`, "get", null)
}
//房屋转租申请列表
export function subletList(subletApplyState){
	return Request(`/front/landlord/sublet/list?pageNum=1&pageSize=10&subletApplyState=${subletApplyState}`, "get", null)
}
//获取转租信息详情
export function subletInfoDetail(leaseId){
	return Request(`/front/landlord/sublet/${leaseId}`, "get", null)
}
//房东同意或拒绝转租
export function subletOperate(data){
	return Request(`/front/landlord/sublet`, "put", data)
}
//信息服务费列表
export function serviceOrderList(payState){
	return Request(`/front/landlord/serviceOrder/list?pageNum=0&pageSize=10&payState=${payState}`, "get", null)
}
//信息服务费详情
export function serviceOrderDetail(id){
	return Request(`/front/landlord/serviceOrder/${id}`, "get", null)
}
//信息服务费支付
export function serviceOrderPay(data){
	return Request(`/front/landlord/serviceOrder/pre/pay`, "post", data)
}
//信息服务费支付状态
export function serviceOrderIsPay(id){
	return Request(`/front/landlord/serviceOrder/isPay/${id}`, "get", null)
}
//房东端首页获取角标
export function badgeCount(){
	return Request(`/front/landlord/room/corner/mark`, "get", null)
}
// 转租详情
export function sublet(id){
	return Request(`/front/broker/sublet/${id}`,'get',null)
}